﻿namespace WindowsFormsApp_mysqldb_sample.Migrations
{
    using System;
    using System.Data.Entity.Migrations;
    
    public partial class InitDb : DbMigration
    {
        public override void Up()
        {
            CreateTable(
                "dbo.AIVNode",
                c => new
                    {
                        Id = c.Int(nullable: false, identity: true),
                        NodeId = c.Int(nullable: false),
                        Name = c.String(unicode: false),
                        NodeType = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.Id);
            
            CreateTable(
                "dbo.AIVNodeStates",
                c => new
                    {
                        NodeId = c.Int(nullable: false),
                        State = c.Int(nullable: false),
                        Owner = c.String(unicode: false),
                    })
                .PrimaryKey(t => t.NodeId);
            
            CreateTable(
                "dbo.Edge",
                c => new
                    {
                        EId = c.Int(nullable: false, identity: true),
                        Enode = c.Int(nullable: false),
                        Estart = c.Int(nullable: false),
                        Eend = c.Int(nullable: false),
                        Edistance = c.Double(nullable: false),
                        EdgeDirection = c.Int(nullable: false),
                        State = c.Int(nullable: false),
                    })
                .PrimaryKey(t => t.EId);
            
        }
        
        public override void Down()
        {
            DropTable("dbo.Edge");
            DropTable("dbo.AIVNodeStates");
            DropTable("dbo.AIVNode");
        }
    }
}
